import 'package:flutter/material.dart';

import '../services/screen_adapter.dart';

class OrderInfoPage extends StatefulWidget {
  OrderInfoPage({Key key}) : super(key: key);

  @override
  _OrderInfoPageState createState() => _OrderInfoPageState();
}

class _OrderInfoPageState extends State<OrderInfoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('订单详情')
      ),
      body: Container(
        child: ListView(
          children: <Widget>[
            /// 收货地址
            Container(
              color: Colors.white,
              child: Column(
                children: <Widget>[
                  ListTile(
                    leading: Icon(Icons.add_location),
                    title: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Text('张三 15245566877'),
                        SizedBox(height: 10),
                        Text('上海市 黄浦区')
                      ]
                    )
                  ),
                  SizedBox(height: 10)
                ]
              )
            ),
            SizedBox(height: 10),
            /// 列表
            Container(
              padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
              color: Colors.white,
              child: Column(
                children: <Widget>[
                  Row(
                    children: <Widget>[
                      Container(
                        width: ScreenAdapter.width(160),
                        child: Image.network('https://www.itying.com/images/flutter/list2.jpg', fit:BoxFit.cover)
                      ),
                      Expanded(
                        flex: 1,
                        child: Container(
                          padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween, // 一个居上一个居下
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: <Widget>[
                              Text('商品标题啊啊啊 收到了我发搜发生的公司的佛山疯狂的少年 地方搜接收到', maxLines: 2),
                              Text('随便洗 随便用 商品标题啊啊啊 收到我发搜发生的公司的佛山疯狂的少年 地方搜接收到', maxLines: 2),
                              ListTile(
                                leading: Text('¥100', style: TextStyle(color: Colors.red)),
                                trailing: Text('x1')
                              )
                              
                            ]
                          )
                        )
                      )
                    ]
                  )

                ]
              )
            ),
            SizedBox(height: 10),
            /// 详情信息
            Container(
              color: Colors.white,
              margin: EdgeInsets.only(top: 10),
              child: Column(
                children: <Widget>[
                  ListTile(
                    title: Row(
                      children: <Widget>[
                        Text('订单编号:', style: TextStyle(fontWeight: FontWeight.bold)),
                        Text('12343254365476')
                      ]
                    )
                  ),
                  ListTile(
                    title: Row(
                      children: <Widget>[
                        Text('下单日期:', style: TextStyle(fontWeight: FontWeight.bold)),
                        Text('2020-07-19')
                      ]
                    )
                  ),
                  ListTile(
                    title: Row(
                      children: <Widget>[
                        Text('支付方式:', style: TextStyle(fontWeight: FontWeight.bold)),
                        Text('支付宝支付')
                      ]
                    )
                  ),
                  ListTile(
                    title: Row(
                      children: <Widget>[
                        Text('配送方式:', style: TextStyle(fontWeight: FontWeight.bold)),
                        Text('顺丰')
                      ]
                    )
                  ),
                ]
              )
            ),
            SizedBox(height: 10),
            /// 总金额
            Container(
              color: Colors.white,
              child: Column(
                children: <Widget>[
                  ListTile(
                    title: Row(
                      children: <Widget>[
                        Text('总金额:', style: TextStyle(fontWeight: FontWeight.bold)),
                        Text('¥500元', style: TextStyle(color: Colors.red))
                      ]
                    )
                  )
                ]
              )
            )

            
          ]
        )
      )
    );
  }
}